<!--
 * @Author: Leng
 * @Date: 2022-11-02 15:24:42
 * @Description: 
 * @FilePath: \vue-leng\src\components\common\zvg.vue
-->
<template>
  <svg class="icon-zvg" aria-hidden="true">
    <use :xlink:href="'#' + icon" :fill="fill"></use>
  </svg>
</template>

<script>
export default {
  name: 'zvg',
  props: {
    // iconfont编码
    modelValue: {
      tye: String,
      default: null,
      require: true
    },
    // 是否支持主题
    theme: {
      type: Boolean,
      default: false
    },
    // 填充色（无填充色的svg才有效）
    fill: {
      type: String,
      default: null
    }
  },
  computed: {
    icon() {
      return this.theme ? $config.theme : this.modelValue
    }
  }
}
</script>
<style lang="scss" scoped>
.icon-zvg{
  width: 0.6rem;
  height: 0.6rem;
}
</style>